package com.dayuanit.utils;

public class PageUtil {
	
	public static final int PER_PAGE = 6;
	public int currentPageNum = 1;
	public int startPageNum = 0;
	public int totlaPageNum = 0;
	
	public PageUtil(int currentPageNum) {
		this.currentPageNum = currentPageNum;
	}
	
	public int getTotalPageNum(int totalNotes) {
		totlaPageNum = totalNotes % PER_PAGE == 0 ? totalNotes / PER_PAGE : (totalNotes / PER_PAGE) + 1;
		return totlaPageNum;
	}
	
	public int getStartPageNum() {
		startPageNum = (currentPageNum - 1) * PER_PAGE;
		return startPageNum;
	}

	public int getCurrentPageNum() {
		return currentPageNum;
	}
	
}
